import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import vueParticles from 'vue-particles'  // 粒子动效插件
import Vcomp from './components/index'  // 
import Toast from './components/toast'  // 全局消息提示框组件
// 导入Websocket
import SocketService from './utils/websocket_service'
Vue.prototype.$Socket = SocketService.Instance

import '@/assets/styles/base.scss'
// import '@/assets/styles/common.scss'
import '@/assets/iconfont/iconfont.css'

Vue.use(vueParticles)
Vue.use(Vcomp)

Vue.config.productionTip = false

Vue.prototype.$Toast = Toast


router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
})

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
